// app.js
App({
  onLaunch() {
    // 初始化云开发环境
    wx.cloud.init({
      env: "mycloud-5gaz607w0eddc87f"
    })

    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        console.log("wx.login success", res);
      },
      fail: res => {
        console.log("wx.login fail", res);
      }
    })
  },

  globalData: {

    tabbarList: [
      {
        "url": "/pages/home/home",
        "icon": "wap-home-o",
        "text": "首页"
      },
      {
        "url": "/pages/shop/shop",
        "icon": "bag-o",
        "text": "买药"
      },
      {
        "url": "/pages/department/department",
        "icon": "search",
        "text": "问诊"
      },
      {
        "url": "/pages/my/my",
        "icon": "contact",
        "text": "我的"
      }
    ],

    userInfo: { },
  },

  setGlobalData: function(data) {
    console.log("setGlobalData, data: ", data);

    this.globalData.userInfo = data;
    console.log("globalData.userInfo: ", this);
  }

})
